# 列表名 = ["元素1","元素2","元素3",....]

# 创建
shopping_list = ["键盘", "鼠标", "屏幕"]
print(shopping_list)  # ['键盘', '鼠标', '屏幕']

# 添加
shopping_list.append("耳机")
shopping_list.append("手柄🎮")
print(shopping_list)  # ['键盘', '鼠标', '屏幕', '耳机', '手柄🎮']

# 移除
shopping_list.remove("耳机")
print(shopping_list)  # ['键盘', '鼠标', '屏幕', '手柄🎮']

# 取值
print(shopping_list[2])  # 屏幕

# 替换
shopping_list[3] = "音箱"
print(shopping_list)  # ['键盘', '鼠标', '屏幕', '音箱']

# 查看列表长度
print(len(shopping_list))  # 4

# 函数
num_list = [1, 3, 4, 5, -5, 0, -12, 100]
# 最大值
print(max(num_list))  # 100
# 最小值
print(min(num_list))  # -12
# 排序（升序）
print(sorted(num_list))  # [-12, -5, 0, 1, 3, 4, 5, 100]
